var userCookieName = "user";
var userCookie = {
		addUserCookie : function(data){
			var Days = 7;
			var exp = new Date();
			exp.setTime(exp.getTime() + Days*24*60*60*1000);
			document.cookie = userCookieName + "="+ escape (data.user) + ";expires=" + exp.toGMTString();
			document.cookie = "ticket="+ escape (data.ticket) + ";expires=" + exp.toGMTString();
		},
		
		getUserInfoCookie : function(){
			var arr,reg=new RegExp("(^| )"+userCookieName+"=([^;]*)(;|$)");
			if(arr=document.cookie.match(reg)) {
				return unescape(arr[2]);
			} else {
				return null;
			}
		}
}